﻿using System.Collections.Generic;
using NUnit.Framework;
using EzDesk.Apps.Model.Attendance;
using System;
namespace EzDesk.Apps.UnitTest.Attendance
{
    [TestFixture]
    public class DayAttendanceEvaluationStatusFixture
    {
        [Test]
        public void 正常状态的评估()
        {
            var evaluation = new DayAttendanceEvaluation()
                                 {
                                     IsNeedToWork = true
                                 };
            Assert.AreEqual(evaluation.Status, "normal");
            
        }

        [Test]
        public void 假期状态状态的评估()
        {
            var evaluation = new DayAttendanceEvaluation()
            {
                IsNeedToWork = true
            };
            
            evaluation.LeaveInfo = new DayLeaveInfo(DateTime.Now.Date)
            {
                Leaves = new List<DayLeaveInfoItem>()
                                                        {
                                                            new DayLeaveInfoItem(){Day = DateTime.Now.Date},
                                                        }
            };
            Assert.AreEqual(evaluation.Status, "leave");
        }
        [Test]
        public void 周末状态的评估()
        {
            var evaluation = new DayAttendanceEvaluation()
            {

            };
            
            evaluation.IsNeedToWork = false;
            Assert.AreEqual(evaluation.Status, "notwork");

        }
        [Test]
        public void 旷工状态的评估()
        {
            var evaluation = new DayAttendanceEvaluation()
            {

            };

            evaluation.IsAbsense = true;
            Assert.AreEqual(evaluation.Status, "absence");

        }
    }
}